/*
 *  SyncIT , easy synchronization of files between computers and devices.
 *  Copyright (C) 2011  Christian Masus <cmasus(at)gmail.com>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version. If redistributing and/or modifying
 *  this file, this notice must be included in the redistributed or
 *  modified copy.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package gui.javagui;

import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JToolBar;

@SuppressWarnings("serial")
public class ControlToolBar extends JToolBar {

	private GuiActions guiActions;

	public ControlToolBar(GuiActions guiActions) {
		super("SyncIT Tools");
		this.guiActions = guiActions;

		setFloatable(false);
		setRollover(true);

		init();
	}

	private void init() {
		JButton addButton = new JButton(guiActions.getAddAction());
		addButton.setHideActionText(true);
		addButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		addButton.setOpaque(false);

		JButton removeButton = new JButton(guiActions.getRemoveAction());
		removeButton.setHideActionText(true);
		removeButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		removeButton.setOpaque(false);


		JButton startButton = new JButton(guiActions.getStartAction());
		startButton.setHideActionText(true);
		startButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		startButton.setOpaque(false);

		JButton pauseButton = new JButton(guiActions.getPauseAction());
		pauseButton.setHideActionText(true);
		pauseButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		pauseButton.setOpaque(false);

		JButton stopButton = new JButton(guiActions.getStopAction());
		stopButton.setHideActionText(true);
		stopButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		stopButton.setOpaque(false);


		JButton moveUpButton = new JButton(guiActions.getMoveUpAction());
		moveUpButton.setHideActionText(true);
		moveUpButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		moveUpButton.setOpaque(false);

		JButton moveDownButton = new JButton(guiActions.getMoveDownAction());
		moveDownButton.setHideActionText(true);
		moveDownButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		moveDownButton.setOpaque(false);


		JButton preferencesButton = new JButton(guiActions.getPreferencesAction());
		preferencesButton.setHideActionText(true);
		preferencesButton.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
		preferencesButton.setOpaque(false);



		add(addButton);
		add(Box.createRigidArea(new Dimension(1,1)));
		add(removeButton);
		addSeparator();
		add(startButton);
		add(Box.createRigidArea(new Dimension(1,1)));
		add(pauseButton);
		add(Box.createRigidArea(new Dimension(1,1)));
		add(stopButton);
		addSeparator();
		add(moveUpButton);
		add(Box.createRigidArea(new Dimension(1,1)));
		add(moveDownButton);
		addSeparator();
		add(preferencesButton);
	}

}
